import React, { useEffect } from 'react';
import { SearchComType } from '../../../interface/search';
import Search from '../../../components/Search';
import { useNavigate } from 'react-router-dom';
import { SearchOutlined } from '@ant-design/icons';
import { Select, Input, Button, Card, Image } from 'antd';

const { Option } = Select;
const { Grid, Meta } = Card;

export default function index() {
  const SearchDom: SearchComType[] = [{
    lable: '直播状态',
    name: 'state',
    element: <Select style={{ width: '200px' }}>
      <Option value='null'>请选择</Option>
      <Option value='0'>已关闭</Option>
      <Option value='1'>直播中</Option>
    </Select>,
    init: 'null'
  }, {
    lable: '经纪人搜索',
    name: 'man',
    element: <Input placeholder='搜索姓名、id'></Input>
  }, {
    lable: '',
    name: '',
    element: <Button htmlType='submit'><SearchOutlined></SearchOutlined></Button>
  }]

  const searchInit = { state: 'null', man: '' }

  function getLiveList(data: any) {
    console.log(data);
  }

  useEffect(() => {
    getLiveList(searchInit)
  }, [])

  return (
    <>
      <h1>直播管理</h1>
      <Search data={SearchDom} func={(val: any) => { getLiveList(val) }}></Search>
      <Card>
        <Grid style={{width: 'calc(100%/6)'}}>
        </Grid>
      </Card>
    </>
  )
}
